package homework01;

public class hoemwork4 {
    public static void main(String[] args) {
        double[] arr = {0.104, -0.03, -0.062, 0.012, -0.061, -0.19, -0.038, 0.009, -0.045, 0.055};
        int count1 = 0;
        int count2 = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] < 0) {
                count2++;
            } else if (arr[i] > 0) {
                count1++;
            }
        }
        System.out.println("赚钱的股票共：" + count1 + "只");
        System.out.println("赔钱的股票共：" + count2 + "只");
    }
}
